package cheme.ProcessEditor;

import org.eclipse.gef.ui.actions.ActionBarContributor;
import org.eclipse.gef.ui.actions.DeleteRetargetAction;
import org.eclipse.gef.ui.actions.GEFActionConstants;
import org.eclipse.gef.ui.actions.RedoRetargetAction;
import org.eclipse.gef.ui.actions.UndoRetargetAction;
import org.eclipse.gef.ui.actions.ZoomComboContributionItem;
import org.eclipse.gef.ui.actions.ZoomInRetargetAction;
import org.eclipse.gef.ui.actions.ZoomOutRetargetAction;
import org.eclipse.jface.action.IToolBarManager;

public class ChemeContributor extends ActionBarContributor
{
	protected void buildActions()
	{
		addRetargetAction(new UndoRetargetAction());
		addRetargetAction(new RedoRetargetAction());
		
		addRetargetAction(new DeleteRetargetAction());
		
		addRetargetAction(new ZoomInRetargetAction());
		addRetargetAction(new ZoomOutRetargetAction());
		
//		IAction cut = getActionRegistry().getAction(ActionFactory.CUT.getId());
//		IAction copy = getActionRegistry().getAction(ActionFactory.COPY.getId());
//		IAction paste = getActionRegistry().getAction(ActionFactory.PASTE.getId());
//		addAction(cut);
//		addAction(copy);
//		addAction(paste);
	}

	protected void declareGlobalActionKeys()
	{
	}

	public void contributeToToolBar(IToolBarManager toolBarManager)
	{
//		toolBarManager.add(getActionRegistry().getAction(ActionFactory.CUT.getId()));
//		toolBarManager.add(getActionRegistry().getAction(ActionFactory.COPY.getId()));
//		toolBarManager.add(getActionRegistry().getAction(ActionFactory.PASTE.getId()));
//		
//		toolBarManager.add(getActionRegistry().getAction(ActionFactory.DELETE.getId()));
//		toolBarManager.add(getActionRegistry().getAction(ActionFactory.UNDO.getId()));
//		toolBarManager.add(getActionRegistry().getAction(ActionFactory.REDO.getId()));
		
		toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.ZOOM_IN));
		toolBarManager.add(getActionRegistry().getAction(GEFActionConstants.ZOOM_OUT));

		toolBarManager.add(new ZoomComboContributionItem(getPage()));
	}
}